#pragma once

#include "Controller.h"

#include <boost/signal.hpp>
#include "../domain/models/CardsCollection.h"
#include "../domain/models/Player.h"
#include "../views/abstract/IAccusationView.h"

namespace Controllers {

	class AccusationController: public Controller
	{
		Views::IAccusationView* view;
		Cards::CardSet searched_cards;
		Players::Player* current_player;
		Cards::CardsCollection cards;

		bool checkCards(Cards::CardSet& picked_cards);
		bool isAccusationCorrect(Cards::CardSet&);
		void onPlayerDecisionSet(bool decision);
		void onCardsInAccusationSet(Cards::CardSet);
		void inactivatePlayer();

	public:
		boost::signal<void ()> accusationCorrectEvent;
		boost::signal<void ()> accusationIncorrectEvent;
		boost::signal<void ()> accusationNotPerformedEvent;

		AccusationController(Players::Player* player, Cards::CardsCollection cards, Cards::CardSet searched_cards);

		void perform();
	};

}

